package com.yoomiito.app.ui.anyview.sdd

import android.content.Context
import android.view.LayoutInflater
import android.widget.LinearLayout
import com.yoomiito.app.R
import com.yoomiito.app.utils.DensityUtil

class SddFreeGoodsListHeaderView (context: Context) : LinearLayout(context){
    val view = LayoutInflater.from(context).inflate(R.layout.view_sdd_free_goods_list_header,null,false)
//    val userPic = view.findViewById<CircleImageView>(R.id.userPic)
//    val userName = view.findViewById<TextView>(R.id.userName)
//    val goodsPic = view.findViewById<ImageView>(R.id.goodsPic)
//    val goods = view.findViewById<View>(R.id.goodsInfo)

    init {
        val lp = LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT)
        lp.bottomMargin = DensityUtil.dp2px(12f)
        addView(view,lp)
    }

//    fun updateData(data:SddFreeGoodsListData){
//         if (TextUtils.isEmpty(data.headimgurl)){
//             userPic.visibility = View.GONE
//        } else {
//             userPic.visibility = View.VISIBLE
//             ImageLoader.getInstance().into(context,data.headimgurl,userPic)
//        }
//
//        if (TextUtils.isEmpty(data.nickname)){
//            userName.visibility = View.GONE
//        } else {
//            userName.visibility = View.VISIBLE
//            userName.text = data.nickname
//        }

//        if (data.goods==null){
//            goods.visibility = View.GONE
//        }else{
//            if (TextUtils.isEmpty(data.goods.productImg)){
//                userName.visibility = View.GONE
//            } else {
//                userName.visibility = View.VISIBLE
//                userName.text = data.nickname
//            }
//            goods.setOnClickListener {  }
//        }
//    }

}